home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
405_01
/
dmanScanner.l
< prev
next >
Wrap
Text File
|
1993-07-17
|
10KB
|
220 lines
/* @(#) dmanScanner.l LexSource asterisk 1.14 93/03/11 14:00:05 (SCCS/s.dmanScanner.l) */
/*
* Nom du Fichier : |>nom_fichier<|
* Titre : |>Titre<|
* Auteur: |>auteur<|
* Date de creation : |>dateCreation<|
*/
/* Description :
* Document de reference : |>doc<|
* Objet : |>objet<|
*
*/
/*
* historique :
* |>date<| |>auteur<| |>objet<|
*/
/* -------------- declaration section -------------- */
%s DANS_LIGNE
%x DANS_COMMENT
%name DmanScanner
%{
static char SccsId[]="@(#) dmanScanner.l LexSource asterisk 1.14 93/03/11 14:00:05 (SCCS/s.dmanScanner.l)";
#include "dmanParser.h"
#define YY_NULL 0
#define YY_USER_ACTION BeginAction();
%}
%define INHERIT
%define LEX_RETURN int
%define LEX ScanValue
%define LEX_PARAM TokenValue &theValue
%define MEMBERS \
protected: \
int theLine,theColumn; \
void BeginAction(); \
virtual void SetDebug(int)=0;
%define CONSTRUCTOR_PARAM void
%define CONSTRUCTOR_INIT : theLine(1),theColumn(1)
%define CONSTRUCTOR_CODE ;
%define TEXT theText
%define LENG theTextLength
SPACES1 [ \t]+
SPACES [ \t]*
LF (\r\n)|(\r)|(\n)|(\x0c)
ANY_CHAR [^\r\n\x0c]
PRINT_CHAR [\x21-\x7e]
/* -------------- rules section -------------- */
%%
<INITIAL>{SPACES1} {BEGIN(INITIAL);}
{SPACES}{LF} {BEGIN(INITIAL);theLine++;theColumn=1;return DmanParser::TOK_LF;}
\\{LF} {BEGIN(DANS_LIGNE);theLine++;theColumn=1;}
<INITIAL>":"[Hh][eE][aA][Dd][Ee][Rr] {BEGIN(DANS_LIGNE);return DmanParser::CMD_HEADER;}
<INITIAL>":"[Ss][eE][cC][Tt][Ii][Oo][Nn] {BEGIN(DANS_LIGNE);return DmanParser::CMD_SECTION;}
<INITIAL>":"[Ss][Ss][eE][cC][Tt][Ii][Oo][Nn] {BEGIN(DANS_LIGNE);return DmanParser::CMD_SSECTION;}
<INITIAL>":"[A-Za-z0-9_]* {BEGIN(DANS_LIGNE);return DmanParser::CMD_BAD;}
<INITIAL>("-") {BEGIN(DANS_LIGNE);return DmanParser::TOK_ITEM1;}
<INITIAL>("--") {BEGIN(DANS_LIGNE);return DmanParser::TOK_ITEM2;}
<INITIAL>("---") {BEGIN(DANS_LIGNE);return DmanParser::TOK_ITEM3;}
<INITIAL>("-"+) {BEGIN(DANS_LIGNE);return DmanParser::TOK_ITEM_BAD;}
<INITIAL>(">") {BEGIN(DANS_LIGNE);return DmanParser::TOK_INDENT1;}
<INITIAL>(">>") {BEGIN(DANS_LIGNE);return DmanParser::TOK_INDENT2;}
<INITIAL>(">>>") {BEGIN(DANS_LIGNE);return DmanParser::TOK_INDENT3;}
<INITIAL>(">"+) {BEGIN(DANS_LIGNE);return DmanParser::TOK_INDENT_BAD;}
\\{SPACES1} {BEGIN(DANS_LIGNE);theValue.theChar=' ';return DmanParser::TOK_CHAR;}
\\{ANY_CHAR} {BEGIN(DANS_LIGNE);theValue.theChar=theText[1];return DmanParser::TOK_CHAR;}
{SPACES1} {BEGIN(DANS_LIGNE);return DmanParser::TOK_SPACE;}
"\"" {BEGIN(DANS_LIGNE);return DmanParser::TOK_DQUOTE;}
"{" {BEGIN(DANS_LIGNE);return DmanParser::TOK_BEGIN;}
"}" {BEGIN(DANS_LIGNE);return DmanParser::TOK_END;}
"<" {BEGIN(DANS_LIGNE);return DmanParser::TOK_INF;}
">" {BEGIN(DANS_LIGNE);return DmanParser::TOK_SUP;}
"Θ" {BEGIN(DANS_LIGNE);theValue.theString="e'";return DmanParser::TOK_COMPOSED2;}
"╔" {BEGIN(DANS_LIGNE);theValue.theString="E'";return DmanParser::TOK_COMPOSED2;}
"Φ" {BEGIN(DANS_LIGNE);theValue.theString="e`";return DmanParser::TOK_COMPOSED2;}
"╚" {BEGIN(DANS_LIGNE);theValue.theString="E`";return DmanParser::TOK_COMPOSED2;}
"Ω" {BEGIN(DANS_LIGNE);theValue.theString="e^";return DmanParser::TOK_COMPOSED2;}
"╩" {BEGIN(DANS_LIGNE);theValue.theString="E^";return DmanParser::TOK_COMPOSED2;}
"δ" {BEGIN(DANS_LIGNE);theValue.theString="e:";return DmanParser::TOK_COMPOSED2;}
"╦" {BEGIN(DANS_LIGNE);theValue.theString="E:";return DmanParser::TOK_COMPOSED2;}
"ß" {BEGIN(DANS_LIGNE);theValue.theString="a'";return DmanParser::TOK_COMPOSED2;}
"┴" {BEGIN(DANS_LIGNE);theValue.theString="A'";return DmanParser::TOK_COMPOSED2;}
"α" {BEGIN(DANS_LIGNE);theValue.theString="a`";return DmanParser::TOK_COMPOSED2;}
"└" {BEGIN(DANS_LIGNE);theValue.theString="A`";return DmanParser::TOK_COMPOSED2;}
"Γ" {BEGIN(DANS_LIGNE);theValue.theString="a^";return DmanParser::TOK_COMPOSED2;}
"┬" {BEGIN(DANS_LIGNE);theValue.theString="A^";return DmanParser::TOK_COMPOSED2;}
"Σ" {BEGIN(DANS_LIGNE);theValue.theString="a:";return DmanParser::TOK_COMPOSED2;}
"─" {BEGIN(DANS_LIGNE);theValue.theString="A:";return DmanParser::TOK_COMPOSED2;}
"π" {BEGIN(DANS_LIGNE);theValue.theString="a~";return DmanParser::TOK_COMPOSED2;}
"├" {BEGIN(DANS_LIGNE);theValue.theString="A~";return DmanParser::TOK_COMPOSED2;}
"τ" {BEGIN(DANS_LIGNE);theValue.theString="c,";return DmanParser::TOK_COMPOSED2;}
"╟" {BEGIN(DANS_LIGNE);theValue.theString="C,";return DmanParser::TOK_COMPOSED2;}
"φ" {BEGIN(DANS_LIGNE);theValue.theString="i'";return DmanParser::TOK_COMPOSED2;}
"═" {BEGIN(DANS_LIGNE);theValue.theString="I'";return DmanParser::TOK_COMPOSED2;}
"∞" {BEGIN(DANS_LIGNE);theValue.theString="i`";return DmanParser::TOK_COMPOSED2;}
"╠" {BEGIN(DANS_LIGNE);theValue.theString="I`";return DmanParser::TOK_COMPOSED2;}
"ε" {BEGIN(DANS_LIGNE);theValue.theString="i^";return DmanParser::TOK_COMPOSED2;}
"╬" {BEGIN(DANS_LIGNE);theValue.theString="I^";return DmanParser::TOK_COMPOSED2;}
"∩" {BEGIN(DANS_LIGNE);theValue.theString="i:";return DmanParser::TOK_COMPOSED2;}
"╧" {BEGIN(DANS_LIGNE);theValue.theString="I:";return DmanParser::TOK_COMPOSED2;}
"·" {BEGIN(DANS_LIGNE);theValue.theString="u'";return DmanParser::TOK_COMPOSED2;}
"┌" {BEGIN(DANS_LIGNE);theValue.theString="U'";return DmanParser::TOK_COMPOSED2;}
"∙" {BEGIN(DANS_LIGNE);theValue.theString="u`";return DmanParser::TOK_COMPOSED2;}
"┘" {BEGIN(DANS_LIGNE);theValue.theString="U`";return DmanParser::TOK_COMPOSED2;}
"√" {BEGIN(DANS_LIGNE);theValue.theString="u^";return DmanParser::TOK_COMPOSED2;}
"█" {BEGIN(DANS_LIGNE);theValue.theString="U^";return DmanParser::TOK_COMPOSED2;}
"ⁿ" {BEGIN(DANS_LIGNE);theValue.theString="u:";return DmanParser::TOK_COMPOSED2;}
"▄" {BEGIN(DANS_LIGNE);theValue.theString="U:";return DmanParser::TOK_COMPOSED2;}
"÷" {BEGIN(DANS_LIGNE);theValue.theString="o:";return DmanParser::TOK_COMPOSED2;}
"╓" {BEGIN(DANS_LIGNE);theValue.theString="U:";return DmanParser::TOK_COMPOSED2;}
"⌠" {BEGIN(DANS_LIGNE);theValue.theString="o^";return DmanParser::TOK_COMPOSED2;}
"╘" {BEGIN(DANS_LIGNE);theValue.theString="O^";return DmanParser::TOK_COMPOSED2;}
"≥" {BEGIN(DANS_LIGNE);theValue.theString="o`";return DmanParser::TOK_COMPOSED2;}
"╥" {BEGIN(DANS_LIGNE);theValue.theString="O`";return DmanParser::TOK_COMPOSED2;}
"≤" {BEGIN(DANS_LIGNE);theValue.theString="o'";return DmanParser::TOK_COMPOSED2;}
"╙" {BEGIN(DANS_LIGNE);theValue.theString="O'";return DmanParser::TOK_COMPOSED2;}
"⌡" {BEGIN(DANS_LIGNE);theValue.theString="o~";return DmanParser::TOK_COMPOSED2;}
"╒" {BEGIN(DANS_LIGNE);theValue.theString="O~";return DmanParser::TOK_COMPOSED2;}
" " {BEGIN(DANS_LIGNE);theValue.theString="y:";return DmanParser::TOK_COMPOSED2;}
"²" {BEGIN(DANS_LIGNE);theValue.theString="y'";return DmanParser::TOK_COMPOSED2;}
"▌" {BEGIN(DANS_LIGNE);theValue.theString="Y'";return DmanParser::TOK_COMPOSED2;}
"±" {BEGIN(DANS_LIGNE);theValue.theString="n~";return DmanParser::TOK_COMPOSED2;}
"╤" {BEGIN(DANS_LIGNE);theValue.theString="N~";return DmanParser::TOK_COMPOSED2;}
"▀" {BEGIN(DANS_LIGNE);theValue.theString="*8";return DmanParser::TOK_COMPOSED1;}
"°" {BEGIN(DANS_LIGNE);theValue.theString="o/";return DmanParser::TOK_COMPOSED2;}
"╪" {BEGIN(DANS_LIGNE);theValue.theString="O/";return DmanParser::TOK_COMPOSED2;}
"µ" {BEGIN(DANS_LIGNE);theValue.theString="*(ae";return DmanParser::TOK_COMPOSED1;}
"╞" {BEGIN(DANS_LIGNE);theValue.theString="*(Ae";return DmanParser::TOK_COMPOSED1;}
"í" {BEGIN(DANS_LIGNE);theValue.theString="*!";return DmanParser::TOK_COMPOSED1;}
"┐" {BEGIN(DANS_LIGNE);theValue.theString="*?";return DmanParser::TOK_COMPOSED1;}
"σ" {BEGIN(DANS_LIGNE);theValue.theString="ao";return DmanParser::TOK_COMPOSED2;}
"┼" {BEGIN(DANS_LIGNE);theValue.theString="Ao";return DmanParser::TOK_COMPOSED2;}
"«" {BEGIN(DANS_LIGNE);theValue.theString="*R";return DmanParser::TOK_COMPOSED1;}
"⌐" {BEGIN(DANS_LIGNE);theValue.theString="(co";return DmanParser::TOK_COMPOSED1;}
"ó" {BEGIN(DANS_LIGNE);theValue.theString="(ct";return DmanParser::TOK_COMPOSED1;}
"%"[A-Z]"%" {BEGIN(DANS_LIGNE);theValue.theChar='?';return DmanParser::TOK_CHAR;} /* mode debug parser/lexer */
"%+%" {SetDebug(1);} /* mode debug parser/lexer */
"%-%" {SetDebug(0);}
"%" {BEGIN(DANS_COMMENT);}
<DANS_COMMENT>{ANY_CHAR}+ {}
<DANS_COMMENT